<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * SimplyPost
 *
 * @author		Pascal Kriete
 * @package		SimplyPost
 * @copyright	Copyright (c) 2008, Pascal Kriete
 * @license 	http://www.gnu.org/licenses/lgpl.txt
 */

// ------------------------------------------------------------------------

/**
 * Home Controller
 *
 * @package		SimplyPost
 * @subpackage	Home
 * @category	Controller
 * @author		Pascal Kriete
 */

class Home extends BaseController {

	/**
	 * Constructor
	 *
	 * @access	public
	 */
	function Home()
	{
		parent::BaseController();
		$this->lang->load('home');
	}
	
	// ------------------------------------------------------------------------
	
	/**
	 * Show all categories with subforums
	 *
	 * @access	public
	 */
	function index()
	{
		set_title($this->lang->line('home_title'));
		$this->breadcrumb->custom();

		$this->load->helper('date');

		$this->load->model('category/Cat_model', 'Category');
		$cats = $this->Category->get_all();		
		
		if ($cats == FALSE)
		{
			$this->load->view('all_empty');
		}
		else
		{
			$data['cats'] = $cats;
			$this->load->model('forum/For_model', 'Forum');

			$this->load->view('home', $data);
		}
	}
	
	// ------------------------------------------------------------------------

	/**
	 * Password hashing test function - LEAVE COMMENTED!
	 *
	 * @access	public
	 *
	function pass_gen()
	{
		ob_start();
		echo '<h3>Your password hash:</h3>';
		echo secure_password('EMAIL', 'PASSWORD');
		
		echo '<h3>The current unix time:</h3>';
		echo time();
		
		$output =& load_class('Output');
		$output->append_output(ob_get_contents());
		@ob_end_clean();
	}
	*/
}